package com.gragra.evaluateNouns.tests;
import static org.junit.Assert.*;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import org.junit.Before;
import org.junit.Test;
import com.gragra.evaluateNouns.ExtendingSegmentation;
import com.gragra.sampling.sequentialStructure.CaseLevel;
import com.gragra.sampling.sequentialStructure.ExtensionInformationValue;
import com.gragra.sampling.sequentialStructure.WordType;
import com.gragra.sequentiaDataGenerator.PunctuationSplitOffSegmenter;
/**
 * 
 * @author Christoph Teichmann
 * 20.04.2013
 */
public class TestExtendingSegmentation
{
	/**
	 * 
	 */
	private ExtendingSegmentation es;
	@Before
	public void setUp() throws Exception
	{
		Object2ObjectOpenHashMap<String, ExtensionInformationValue> assignments = new Object2ObjectOpenHashMap<String, ExtensionInformationValue>();
		assignments.put("PUNCT", CaseLevel.CapsLockCase);
		assignments.put("NN",WordType.Noun);
		es = new ExtendingSegmentation(new PunctuationSplitOffSegmenter("PUNCT"), assignments);
	}
	@Test
	public void testSegment()
	{
		ObjectArrayList<String[]> ret = es.segment("Mann.|NN");
		assertEquals(ret.size(),2);
		String[] one = ret.get(0);
		String[] two = ret.get(1);
		assertEquals("Mann",one[0]);
		assertEquals("NN",one[1]);
		assertEquals("WordTypeLevel",one[2]);
		assertEquals("Noun",one[3]);
		assertEquals(".",two[0]);
		assertEquals("PUNCT",two[1]);
		assertEquals("CaseTypeLevel",two[2]);
		assertEquals("CapsLockCase",two[3]);
	}
}